package com.gxc.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 获取配置文件中的常量属性. 注意：需要在启动类加： @EnableConfigurationProperties({ConfigBeanProperties.class})
 *
 * @author 宫新程
 * @since 2018/12/3 11:00 AM
 */
@Configuration //必须加（如果加载自建的properties文件）
@ConfigurationProperties(prefix = "com.gxc")
@PropertySource("classpath:cfg/dbConfig.properties")
@Data
public class ConfigBeanProperties {
  private String name;
  private String want;
  private String username;
  private String password;
}
